Class: NSXDriver::NSXConstants

Inherits:
Object
  • Object
show all
Defined in:
lib/nsx_constants.rb

Constant Summary collapse

NSXT =

CONSTANTS

'NSX-T'
NSXV =
'NSX-V'
HEADER_JSON =
{ 'Content-Type' => 'application/json' }
HEADER_XML =
{ 'Content-Type' => 'application/xml' }
NSXT_EXTENSION_LIST =

NSX Manager

'com.vmware.nsx.management.nsxt'
NSXV_EXTENSION_LIST =
'com.vmware.vShieldManager'
NSXT_BASE =
'/api/v1'
NSXV_BASE =
'/api/2.0'
NSXV_TZS =

Transport Zones

NSXV_BASE + '/vdn/scopes'
NSXV_TZS_XPATH =
'//vdnScope'
NSXT_TZS =
NSXT_BASE + '/transport-zones'
NSXV_AUTH =

VirtualWire

NSXV_BASE + '/services/auth/token'
NSXV_LS_TYPE =
'NSX-V'
NSXV_LS_NAME_XPATH =
'//virtualWire/name'
NSXV_LS_VNI_XPATH =
'//virtualWire/vdnId'
NSXV_LS_BACKING_XPATH =
'//virtualWire/vdsContextWithBacking' \
'/backingValue'
NSXV_LS_OBJECTID_XPATH =
'//virtualWire/vdsContextWithBacking' \
'/switch/objectId'
NSXV_LS_XPATH =
'//virtualWire'
NSXV_LS_SECTION =
NSXV_BASE + '/vdn/virtualwires/'
NSXV_TZ_SECTION =
NSXV_BASE + '/vdn/scopes/'
NSXV_TZ_XPATH =
'//virtualWire/vdnScopeId'
NSXT_AUTH =

OpaqueNetwork

NSXT_BASE + '/aaa/registration-token'
NSXT_LS_TYPE =
'Opaque Network'
NSXT_LS_SECTION =
NSXT_BASE + '/logical-switches/'
ONE_SECTION_NAME =

DFW

'OpenNebula'
NSXT_DFW_BASE =
NSXT_BASE + '/firewall'
NSXV_DFW_BASE =
'/api/4.0/firewall/globalroot-0/config'
NSXT_DFW_SECTIONS =
'/sections'
NSXV_DFW_SECTIONS =
'/layer3sections'
NSXV_DFW_SECTION_XPATH =
'//section'
NSXV_DFW_RULE_XPATH =
'//rule'
NSXT_RULE_BASE =

RULE

NSXT_BASE + '/firewall/rules'
NSXT_RULE_PROTOCOL =
{
    'TCP' => {
        :service => {
            :l4_protocol => 'TCP',
            :source_ports => [],
            :destination_ports => [],
            :resource_type => 'L4PortSetNSService'
        }
    },
    'UDP' => {
        :service => {
            :l4_protocol => 'UDP',
            :source_ports => [],
            :destination_ports => [],
            :resource_type => 'L4PortSetNSService'
        }
    },
    'ICMP' => {
        :service => {
            :protocol => 'ICMPv4',
            :resource_type => 'ICMPTypeNSService'
        }
    },
    'ICMPv6' => {
        :service => {
            :protocol => 'ICMPv6',
            :resource_type => 'ICMPTypeNSService'
        }
    }
}
NSXV_RULE_BASE =
'xxx'
NSX_RULE_IPSEC_PORTS =
['500', '4500']
NSXT_LP_BASE =

Logical Ports

NSXT_BASE + '/logical-ports/'
NSXV_LP_BASE =
''
MSG_INCOMPLETE_REQ =

Messages

'Incomplete request, NSX_MANAGER, NSX_USER, \
NSX_PASSWORD and NSX_TYPE are needed'
MSG_INVALID_REQ =
'Invalid request, check that NSX_MANAGER, NSX_USER, \
NSX_PASSWORD and NSX_TYPE are correct'
MSG_INVALID_NSXTYPE =
'Invalid NSX-TYPE: Only NSX-T and NSX-V are \
supported'
CODE_OK =

Responses codes 2xx

200
CODE_CREATED =
201
CODE_ACCEPTED =
202
CODE_NO_CONTENT =
204
CODE_BAD_REQUEST =

4xx

400
CODE_UNAUTHORIZED =
401
CODE_FORBIDDEN =
403
CODE_NOT_FOUND =
404
CODE_METHOD_NOT_ALLOWED =
405
CODE_NOT_ACCEPTABLE =
406
CODE_INTERNAL_SERVER_ERROR =

5xx

500
CODE_BAD_GATEWAY =
502
CODE_SERVICE_UNAVAILABLE =
503
CODE_GATEWAY_TIMEOUT =
504