From 088847866443a0258ec555036894416f075e6b4c Mon Sep 17 00:00:00 2001 From: Kobi Samoray Date: Wed, 23 Aug 2023 12:44:32 +0300 Subject: [PATCH] Transport node realization data source Realization data source for nsxt_transport_node resource. Signed-off-by: Kobi Samoray --- ..._source_nsxt_transport_node_realization.go | 96 ++++++ nsxt/provider.go | 1 + .../nsx/transport_nodes/CapabilitiesClient.go | 91 ++++++ .../nsx/transport_nodes/CapabilitiesTypes.go | 69 +++++ .../nsx/transport_nodes/ModulesClient.go | 94 ++++++ .../nsx/transport_nodes/ModulesTypes.go | 69 +++++ .../transport_nodes/PnicBondStatusClient.go | 93 ++++++ .../transport_nodes/PnicBondStatusTypes.go | 87 ++++++ .../RemoteTransportNodeStatusClient.go | 107 +++++++ .../RemoteTransportNodeStatusTypes.go | 183 ++++++++++++ .../nsx/transport_nodes/StateClient.go | 140 +++++++++ .../nsxt-mp/nsx/transport_nodes/StateTypes.go | 160 ++++++++++ .../nsx/transport_nodes/StatusClient.go | 138 +++++++++ .../nsx/transport_nodes/StatusTypes.go | 136 +++++++++ .../TransportNodesPackageTypes.go | 11 + .../nsx/transport_nodes/TunnelsClient.go | 160 ++++++++++ .../nsx/transport_nodes/TunnelsTypes.go | 273 ++++++++++++++++++ vendor/modules.txt | 1 + .../transport_node_realization.html.markdown | 75 +++++ website/docs/r/manager_cluster.html.markdown | 2 +- 20 files changed, 1985 insertions(+), 1 deletion(-) create mode 100644 nsxt/data_source_nsxt_transport_node_realization.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go create mode 100644 vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go create mode 100644 website/docs/d/transport_node_realization.html.markdown diff --git a/nsxt/data_source_nsxt_transport_node_realization.go b/nsxt/data_source_nsxt_transport_node_realization.go new file mode 100644 index 000000000..cc4eecb47 --- /dev/null +++ b/nsxt/data_source_nsxt_transport_node_realization.go @@ -0,0 +1,96 @@ +/* Copyright © 2023 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes" +) + +func dataSourceNsxtTransportNodeRealization() *schema.Resource { + return &schema.Resource{ + Read: dataSourceNsxtTransportNodeRealizationRead, + + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Required: true, + Description: "Unique ID of this resource", + }, + "timeout": { + Type: schema.TypeInt, + Description: "Realization timeout in seconds", + Optional: true, + Default: 1200, + ValidateFunc: validation.IntAtLeast(1), + }, + "delay": { + Type: schema.TypeInt, + Description: "Initial delay to start realization checks in seconds", + Optional: true, + Default: 1, + ValidateFunc: validation.IntAtLeast(0), + }, + "state": { + Type: schema.TypeString, + Computed: true, + Description: "Overall state of desired configuration", + }, + }, + } +} + +func dataSourceNsxtTransportNodeRealizationRead(d *schema.ResourceData, m interface{}) error { + connector := getPolicyConnector(m) + client := transport_nodes.NewStateClient(connector) + + id := d.Get("id").(string) + delay := d.Get("delay").(int) + timeout := d.Get("timeout").(int) + + pendingStates := []string{ + model.TransportNodeState_STATE_PENDING, + model.TransportNodeState_STATE_IN_PROGRESS, + model.TransportNodeState_STATE_IN_SYNC, + model.TransportNodeState_STATE_UNKNOWN, + } + targetStates := []string{ + model.TransportNodeState_STATE_SUCCESS, + model.TransportNodeState_STATE_FAILED, + model.TransportNodeState_STATE_PARTIAL_SUCCESS, + model.TransportNodeState_STATE_ORPHANED, + model.TransportNodeState_STATE_ERROR, + } + stateConf := &resource.StateChangeConf{ + Pending: pendingStates, + Target: targetStates, + Refresh: func() (interface{}, string, error) { + state, err := client.Get(id) + if err != nil { + return state, model.TransportNodeState_STATE_ERROR, logAPIError("Error while waiting for realization of transport node", err) + } + + log.Printf("[DEBUG] Current realization state for Transport Node %s is %s", id, *state.State) + + d.Set("state", state.State) + return state, *state.State, nil + }, + Timeout: time.Duration(timeout) * time.Second, + MinTimeout: 1 * time.Second, + Delay: time.Duration(delay) * time.Second, + } + _, err := stateConf.WaitForState() + if err != nil { + return fmt.Errorf("failed to get realization information for %s: %v", id, err) + } + + return nil +} diff --git a/nsxt/provider.go b/nsxt/provider.go index c3c3ac65e..e0dd400c7 100644 --- a/nsxt/provider.go +++ b/nsxt/provider.go @@ -282,6 +282,7 @@ func Provider() *schema.Provider { "nsxt_policy_gateway_prefix_list": dataSourceNsxtPolicyGatewayPrefixList(), "nsxt_policy_gateway_route_map": dataSourceNsxtPolicyGatewayRouteMap(), "nsxt_uplink_host_switch_profile": dataSourceNsxtUplinkHostSwitchProfile(), + "nsxt_transport_node_realization": dataSourceNsxtTransportNodeRealization(), }, ResourcesMap: map[string]*schema.Resource{ diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go new file mode 100644 index 000000000..a2876186f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.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: Capabilities +// Used by client-side stubs. + +package transport_nodes + +import ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.NodeCapabilitiesResult, error) +} + +type capabilitiesClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewCapabilitiesClient(connector vapiProtocolClient_.Connector) *capabilitiesClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.capabilities") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "get": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + cIface := capabilitiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *capabilitiesClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *capabilitiesClient) Get(transportNodeIdParam string) (nsxModel.NodeCapabilitiesResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + operationRestMetaData := capabilitiesGetRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(capabilitiesGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.NodeCapabilitiesResult + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.capabilities", "get", inputDataValue, executionContext) + var emptyOutput nsxModel.NodeCapabilitiesResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), CapabilitiesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.NodeCapabilitiesResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go new file mode 100644 index 000000000..bbf0b8136 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func capabilitiesGetInputType() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = vapiBindings_.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func CapabilitiesGetOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.NodeCapabilitiesResultBindingType) +} + +func capabilitiesGetRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.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"] = vapiBindings_.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["transportNodeId"] = vapiBindings_.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go new file mode 100644 index 000000000..d488e20ad --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesClient.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: Modules +// Used by client-side stubs. + +package transport_nodes + +import ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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 + // + // Deprecated: This API element is deprecated. + // + // @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) (nsxModel.SoftwareModuleResult, error) +} + +type modulesClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewModulesClient(connector vapiProtocolClient_.Connector) *modulesClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.modules") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "get": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + mIface := modulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *modulesClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *modulesClient) Get(nodeIdParam string) (nsxModel.SoftwareModuleResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + operationRestMetaData := modulesGetRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(modulesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.SoftwareModuleResult + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.modules", "get", inputDataValue, executionContext) + var emptyOutput nsxModel.SoftwareModuleResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ModulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.SoftwareModuleResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go new file mode 100644 index 000000000..1728dc00c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func modulesGetInputType() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func ModulesGetOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.SoftwareModuleResultBindingType) +} + +func modulesGetRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["nodeId"] = vapiBindings_.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go new file mode 100644 index 000000000..6224900ad --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.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. + +// Interface file for service: PnicBondStatus +// Used by client-side stubs. + +package transport_nodes + +import ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.PnicBondStatusListResult, error) +} + +type pnicBondStatusClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewPnicBondStatusClient(connector vapiProtocolClient_.Connector) *pnicBondStatusClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.pnic_bond_status") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "list": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + pIface := pnicBondStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *pnicBondStatusClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *pnicBondStatusClient) List(nodeIdParam string, statusParam *string) (nsxModel.PnicBondStatusListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + operationRestMetaData := pnicBondStatusListRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(pnicBondStatusListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.PnicBondStatusListResult + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.pnic_bond_status", "list", inputDataValue, executionContext) + var emptyOutput nsxModel.PnicBondStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), PnicBondStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.PnicBondStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go new file mode 100644 index 000000000..b32053794 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["status"] = "Status" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func PnicBondStatusListOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.PnicBondStatusListResultBindingType) +} + +func pnicBondStatusListRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["status"] = "Status" + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["nodeId"] = vapiBindings_.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go new file mode 100644 index 000000000..8bba0396c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go @@ -0,0 +1,107 @@ +// 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 ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.TransportNodeStatusListResult, error) +} + +type remoteTransportNodeStatusClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewRemoteTransportNodeStatusClient(connector vapiProtocolClient_.Connector) *remoteTransportNodeStatusClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.remote_transport_node_status") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "list": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + rIface := remoteTransportNodeStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *remoteTransportNodeStatusClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.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) (nsxModel.TransportNodeStatusListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + operationRestMetaData := remoteTransportNodeStatusListRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.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 nsxModel.TransportNodeStatusListResult + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.remote_transport_node_status", "list", inputDataValue, executionContext) + var emptyOutput nsxModel.TransportNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), RemoteTransportNodeStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TransportNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go new file mode 100644 index 000000000..3b70ebea3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fields["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + fields["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + fields["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["tunnel_status"] = vapiBindings_.NewOptionalType(vapiBindings_.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 = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func RemoteTransportNodeStatusListOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TransportNodeStatusListResultBindingType) +} + +func remoteTransportNodeStatusListRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fields["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + fields["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + fields["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["tunnel_status"] = vapiBindings_.NewOptionalType(vapiBindings_.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["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + paramsTypeMap["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["tunnel_status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + paramsTypeMap["nodeId"] = vapiBindings_.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 vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateClient.go new file mode 100644 index 000000000..d39987c59 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateClient.go @@ -0,0 +1,140 @@ +// 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 ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.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) (nsxModel.TransportNodeStateListResult, error) +} + +type stateClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewStateClient(connector vapiProtocolClient_.Connector) *stateClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.state") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "get": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(transportNodeIdParam string) (nsxModel.TransportNodeState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + operationRestMetaData := stateGetRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.TransportNodeState + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.state", "get", inputDataValue, executionContext) + var emptyOutput nsxModel.TransportNodeState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), StateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TransportNodeState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *stateClient) List(mmStateParam *string, statusParam *string, vtepIpParam *string) (nsxModel.TransportNodeStateListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + operationRestMetaData := stateListRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(stateListInputType(), typeConverter) + sv.AddStructField("MmState", mmStateParam) + sv.AddStructField("Status", statusParam) + sv.AddStructField("VtepIp", vtepIpParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.TransportNodeStateListResult + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.state", "list", inputDataValue, executionContext) + var emptyOutput nsxModel.TransportNodeStateListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), StateListOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TransportNodeStateListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StateTypes.go new file mode 100644 index 000000000..5939683e5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = vapiBindings_.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func StateGetOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TransportNodeStateBindingType) +} + +func stateGetRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.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"] = vapiBindings_.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["transportNodeId"] = vapiBindings_.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["mm_state"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["vtep_ip"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["mm_state"] = "MmState" + fieldNameMap["status"] = "Status" + fieldNameMap["vtep_ip"] = "VtepIp" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func StateListOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TransportNodeStateListResultBindingType) +} + +func stateListRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mm_state"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["vtep_ip"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["mm_state"] = "MmState" + fieldNameMap["status"] = "Status" + fieldNameMap["vtep_ip"] = "VtepIp" + paramsTypeMap["vtep_ip"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["mm_state"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["status"] = vapiBindings_.NewOptionalType(vapiBindings_.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 vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusClient.go new file mode 100644 index 000000000..d4f17de63 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusClient.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. + +// Interface file for service: Status +// Used by client-side stubs. + +package transport_nodes + +import ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.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) (nsxModel.TransportNodeStatus, error) +} + +type statusClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewStatusClient(connector vapiProtocolClient_.Connector) *statusClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.status") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "get": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get_0"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeTypeParam *string) (nsxModel.HeatMapTransportZoneStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + operationRestMetaData := statusGetRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeType", nodeTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.HeatMapTransportZoneStatus + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.status", "get", inputDataValue, executionContext) + var emptyOutput nsxModel.HeatMapTransportZoneStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), StatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.HeatMapTransportZoneStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get0(nodeIdParam string, sourceParam *string) (nsxModel.TransportNodeStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + operationRestMetaData := statusGet0RestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(statusGet0InputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.TransportNodeStatus + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.status", "get_0", inputDataValue, executionContext) + var emptyOutput nsxModel.TransportNodeStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), StatusGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TransportNodeStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go new file mode 100644 index 000000000..342af6c33 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_type"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func StatusGetOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.HeatMapTransportZoneStatusBindingType) +} + +func statusGetRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_type"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + paramsTypeMap["node_type"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + queryParams["node_type"] = "node_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func StatusGet0OutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TransportNodeStatusBindingType) +} + +func statusGet0RestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["nodeId"] = vapiBindings_.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go new file mode 100644 index 000000000..a44de61e6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/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/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go new file mode 100644 index 000000000..93e9ea100 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.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. + +// Interface file for service: Tunnels +// Used by client-side stubs. + +package transport_nodes + +import ( + vapiStdErrors_ "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiCore_ "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + nsxModel "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = vapiCore_.SupportedByRuntimeVersion2 + +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) (nsxModel.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 encapParam Tunnel encapsulation type (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, encapParam *string, includedFieldsParam *string, pageSizeParam *int64, remoteNodeIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (nsxModel.TunnelList, error) +} + +type tunnelsClient struct { + connector vapiProtocolClient_.Connector + interfaceDefinition vapiCore_.InterfaceDefinition + errorsBindingMap map[string]vapiBindings_.BindingType +} + +func NewTunnelsClient(connector vapiProtocolClient_.Connector) *tunnelsClient { + interfaceIdentifier := vapiCore_.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.tunnels") + methodIdentifiers := map[string]vapiCore_.MethodIdentifier{ + "get": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": vapiCore_.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := vapiCore_.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]vapiBindings_.BindingType) + + tIface := tunnelsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tunnelsClient) GetErrorBindingType(errorName string) vapiBindings_.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return vapiStdErrors_.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tunnelsClient) Get(nodeIdParam string, tunnelNameParam string, sourceParam *string) (nsxModel.TunnelProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + operationRestMetaData := tunnelsGetRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(tunnelsGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("TunnelName", tunnelNameParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput nsxModel.TunnelProperties + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.tunnels", "get", inputDataValue, executionContext) + var emptyOutput nsxModel.TunnelProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), TunnelsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TunnelProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tunnelsClient) List(nodeIdParam string, bfdDiagnosticCodeParam *string, cursorParam *string, encapParam *string, includedFieldsParam *string, pageSizeParam *int64, remoteNodeIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (nsxModel.TunnelList, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + operationRestMetaData := tunnelsListRestMetadata() + executionContext.SetConnectionMetadata(vapiCore_.RESTMetadataKey, operationRestMetaData) + executionContext.SetConnectionMetadata(vapiCore_.ResponseTypeKey, vapiCore_.NewResponseType(true, false)) + + sv := vapiBindings_.NewStructValueBuilder(tunnelsListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("BfdDiagnosticCode", bfdDiagnosticCodeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Encap", encapParam) + 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 nsxModel.TunnelList + return emptyOutput, vapiBindings_.VAPIerrorsToError(inputError) + } + + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.tunnels", "list", inputDataValue, executionContext) + var emptyOutput nsxModel.TunnelList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), TunnelsListOutputType()) + if errorInOutput != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInOutput) + } + return output.(nsxModel.TunnelList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, vapiBindings_.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go new file mode 100644 index 000000000..fc5decaff --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.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. + +// 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 ( + vapiBindings_ "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + vapiData_ "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + vapiProtocol_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + nsxModel "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 ``encap`` of method Tunnels#list. +const Tunnels_LIST_ENCAP_UNKNOWN_ENCAP = "UNKNOWN_ENCAP" + +// Possible value for ``encap`` of method Tunnels#list. +const Tunnels_LIST_ENCAP_GENEVE = "GENEVE" + +// Possible value for ``encap`` of method Tunnels#list. +const Tunnels_LIST_ENCAP_VXLAN = "VXLAN" + +// 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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fields["tunnel_name"] = vapiBindings_.NewStringType() + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["tunnel_name"] = "TunnelName" + fieldNameMap["source"] = "Source" + var validators = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func TunnelsGetOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TunnelPropertiesBindingType) +} + +func tunnelsGetRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fields["tunnel_name"] = vapiBindings_.NewStringType() + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["tunnel_name"] = "TunnelName" + fieldNameMap["source"] = "Source" + paramsTypeMap["tunnel_name"] = vapiBindings_.NewStringType() + paramsTypeMap["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["nodeId"] = vapiBindings_.NewStringType() + paramsTypeMap["tunnelName"] = vapiBindings_.NewStringType() + pathParams["node_id"] = "nodeId" + pathParams["tunnel_name"] = "tunnelName" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return vapiProtocol_.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() vapiBindings_.StructType { + fields := make(map[string]vapiBindings_.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = vapiBindings_.NewStringType() + fields["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["encap"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + fields["remote_node_id"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + fields["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["encap"] = "Encap" + 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 = []vapiBindings_.Validator{} + return vapiBindings_.NewStructType("operation-input", fields, reflect.TypeOf(vapiData_.StructValue{}), fieldNameMap, validators) +} + +func TunnelsListOutputType() vapiBindings_.BindingType { + return vapiBindings_.NewReferenceType(nsxModel.TunnelListBindingType) +} + +func tunnelsListRestMetadata() vapiProtocol_.OperationRestMetadata { + fields := map[string]vapiBindings_.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]vapiBindings_.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = vapiBindings_.NewStringType() + fields["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["encap"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + fields["remote_node_id"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + fields["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fields["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["encap"] = "Encap" + 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["cursor"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["sort_ascending"] = vapiBindings_.NewOptionalType(vapiBindings_.NewBooleanType()) + paramsTypeMap["included_fields"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["bfd_diagnostic_code"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["encap"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["sort_by"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["source"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["node_id"] = vapiBindings_.NewStringType() + paramsTypeMap["page_size"] = vapiBindings_.NewOptionalType(vapiBindings_.NewIntegerType()) + paramsTypeMap["remote_node_id"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["status"] = vapiBindings_.NewOptionalType(vapiBindings_.NewStringType()) + paramsTypeMap["nodeId"] = vapiBindings_.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["encap"] = "encap" + 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 vapiProtocol_.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/vendor/modules.txt b/vendor/modules.txt index 28b85e987..12166b849 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -317,6 +317,7 @@ github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/fabric github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/logical_routers/nat github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/node +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/transport_nodes # github.com/zclconf/go-cty v1.10.0 ## explicit; go 1.12 github.com/zclconf/go-cty/cty diff --git a/website/docs/d/transport_node_realization.html.markdown b/website/docs/d/transport_node_realization.html.markdown new file mode 100644 index 000000000..d27119439 --- /dev/null +++ b/website/docs/d/transport_node_realization.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Realization" +layout: "nsxt" +page_title: "NSXT: transport_node_realization" +description: Transport node resource realization information. +--- + +# nsxt_transport_node_realization + +This data source provides information about the realization of a transport node resource on NSX manager. This data source will wait until realization is determined as either success or error. It is recommended to use this data source if further configuration depends on transport node realization. + +## Example Usage + +```hcl +resource "nsxt_transport_node" "test" { + description = "Terraform-deployed edge node" + display_name = "tf_edge_node" + standard_host_switch { + host_switch_mode = "STANDARD" + host_switch_type = "NVDS" + ip_assignment { + static_ip_pool_id = data.nsxt_ip_pool.ipp1.id + } + transport_zone_endpoint { + transport_zone_id = data.nsxt_transport_zone.tz1.id + transport_zone_profile_id = ["52035bb3-ab02-4a08-9884-18631312e50a"] + } + host_switch_profile_id = [nsxt_uplink_host_switch_profile.hsw_profile1.id] + is_migrate_pnics = false + pnics { + device_name = "fp-eth0" + uplink_name = "uplink1" + } + } + edge_node { + deployment_config { + form_factor = "SMALL" + node_user_settings { + cli_password = "some_cli_password" + root_password = "some_other_password" + } + vm_deployment_config { + management_network_id = data.vsphere_network.network1.id + data_network_ids = [data.vsphere_network.network1.id] + compute_id = data.vsphere_compute_cluster.compute_cluster1.id + storage_id = data.vsphere_datastore.datastore1.id + vc_id = nsxt_compute_manager.vc1.id + host_id = data.vsphere_host.host1.id + } + } + node_settings { + hostname = "tf_edge_node" + allow_ssh_root_login = true + enable_ssh = true + } + } +} + +data "nsxt_transport_node_realization" "test" { + id = nsxt_transport_node.test.id + timeout = 60 +} +``` + +## Argument Reference + +* `id` - (Required) ID of the resource. +* `delay` - (Optional) Delay (in seconds) before realization polling is started. Default is set to 1. +* `timeout` - (Optional) Timeout (in seconds) for realization polling. Default is set to 1200. + +## Attributes Reference + +In addition to arguments listed above, the following attributes are exported: + +* `state` - The realization state of the resource: "pending", "in_progress", "success", "failed", "partial_success", "orphaned", "unknown", "error", "in_sync". diff --git a/website/docs/r/manager_cluster.html.markdown b/website/docs/r/manager_cluster.html.markdown index 84851fcea..6b8a0fb0b 100644 --- a/website/docs/r/manager_cluster.html.markdown +++ b/website/docs/r/manager_cluster.html.markdown @@ -43,4 +43,4 @@ The following arguments are supported: ## Importing -Importing is not supported for this resource. \ No newline at end of file +Importing is not supported for this resource.