def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', { 'section_id': type.StringType(), 'rule_id': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/api/v1/pbr/sections/{section-id}/rules/{rule-id}/stats', path_variables={ 'section_id': 'section-id', 'rule_id': 'rule-id', }, query_parameters={}, content_type='application/json') # properties for list operation list_input_type = type.StructType('operation-input', { 'section_id': type.StringType(), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/pbr/sections/{section-id}/rules/stats', path_variables={ 'section_id': 'section-id', }, query_parameters={}, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'PBRStats'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'PBRStatsList'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.pbr.sections.rules.stats', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'component_type': type.OptionalType(type.StringType()), 'cursor': type.OptionalType(type.StringType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), 'summary': type.OptionalType(type.BooleanType()), 'sync': type.OptionalType(type.BooleanType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/migration/migration-unit-groups/aggregate-info', path_variables={ }, query_parameters={ 'component_type': 'component_type', 'cursor': 'cursor', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', 'summary': 'summary', 'sync': 'sync', }, content_type='application/json' ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'MigrationUnitGroupAggregateInfoListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.migration.migration_unit_groups.aggregate_info', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'template_id': type.StringType(), 'compute_collection_id': type.OptionalType(type.StringType()), 'cursor': type.OptionalType(type.StringType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/api/v1/compute-collection-transport-node-templates/{template-id}/state', path_variables={ 'template_id': 'template-id', }, query_parameters={ 'compute_collection_id': 'compute_collection_id', 'cursor': 'cursor', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json') operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType( 'com.vmware.nsx.model_client', 'ComputeCollectionTransportNodeTemplateStateList'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx.compute_collection_transport_node_templates.state', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for set operation set_input_type = type.StructType('operation-input', { 'interface_name': type.IdType(resource_types='com.vmware.appliance.networking.interfaces'), 'config': type.ReferenceType(__name__, 'Ipv6.Config'), }) set_error_dict = { 'com.vmware.vapi.std.errors.resource_busy': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } set_input_value_validator_list = [ ] set_output_validator_list = [ ] set_rest_metadata = OperationRestMetadata( http_method='PUT', url_template='/appliance/networking/interfaces/{interface_name}/ipv6', path_variables={ 'interface_name': 'interface_name', }, query_parameters={ } ) # properties for get operation get_input_type = type.StructType('operation-input', { 'interface_name': type.IdType(resource_types='com.vmware.appliance.networking.interfaces'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } get_input_value_validator_list = [ ] get_output_validator_list = [ ] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/appliance/networking/interfaces/{interface_name}/ipv6', path_variables={ 'interface_name': 'interface_name', }, query_parameters={ } ) operations = { 'set': { 'input_type': set_input_type, 'output_type': type.VoidType(), 'errors': set_error_dict, 'input_value_validator_list': set_input_value_validator_list, 'output_validator_list': set_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Ipv6.Info'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'set': set_rest_metadata, 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.appliance.networking.interfaces.ipv6', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'node_id': type.StringType(), 'source': type.OptionalType(type.StringType()), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/cluster/nodes/{node-id}/status', path_variables={ 'node_id': 'node-id', }, query_parameters={ 'source': 'source', }, content_type='application/json') # properties for getall operation getall_input_type = type.StructType('operation-input', {}) getall_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } getall_input_value_validator_list = [] getall_output_validator_list = [] getall_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/cluster/nodes/status', path_variables={}, query_parameters={}, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ClusterNodeStatus'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'getall': { 'input_type': getall_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ClustersAggregateInfo'), 'errors': getall_error_dict, 'input_value_validator_list': getall_input_value_validator_list, 'output_validator_list': getall_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, 'getall': getall_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.cluster.nodes.status', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
class TimeSeries(VapiInterface): """ The ``TimeSeries`` class provides methods to gather statistical values for clusters, namespaces and pods. """ _VAPI_SERVICE_ID = 'com.vmware.vcenter.namespace_management.stats.time_series' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _TimeSeriesStub) self._VAPI_OPERATION_IDS = {} class TimeSeries(VapiStruct): """ A set of timestamps and statistical values representing a time series. The lengths of :attr:`TimeSeries.TimeSeries.time_stamps` and :attr:`TimeSeries.TimeSeries.values` will always match each other. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, counter=None, time_stamps=None, values=None, ): """ :type counter: :class:`str` :param counter: Counter identifier. :type time_stamps: :class:`list` of :class:`long` :param time_stamps: Sequence of UNIX timestamp values at which statistical values were sampled. https://en.wikipedia.org/wiki/Unix_time :type values: :class:`list` of :class:`long` :param values: Sequence of sampled values corresponding to the timestamps in tss. """ self.counter = counter self.time_stamps = time_stamps self.values = values VapiStruct.__init__(self) TimeSeries._set_binding_type( type.StructType( 'com.vmware.vcenter.namespace_management.stats.time_series.time_series', { 'counter': type.StringType(), 'time_stamps': type.ListType(type.IntegerType()), 'values': type.ListType(type.IntegerType()), }, TimeSeries, False, None)) class PodIdentifier(VapiStruct): """ Pod identifier. These are the fields required to uniquely identify a pod. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, namespace=None, pod_name=None, ): """ :type namespace: :class:`str` :param namespace: The namespace that the pod is running in. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.vcenter.namespaces.Instance``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.vcenter.namespaces.Instance``. :type pod_name: :class:`str` :param pod_name: The name of the pod itself. """ self.namespace = namespace self.pod_name = pod_name VapiStruct.__init__(self) PodIdentifier._set_binding_type( type.StructType( 'com.vmware.vcenter.namespace_management.stats.time_series.pod_identifier', { 'namespace': type.IdType( resource_types='com.vmware.vcenter.namespaces.Instance'), 'pod_name': type.StringType(), }, PodIdentifier, False, None)) class Spec(VapiStruct): """ This structure is sent in a request for TimeSeries data and is used to specify what object stats should be returned for. .. tip:: The arguments are used to initialize data attributes with the same names. """ _validator_list = [ UnionValidator( 'obj_type', { 'POD': [('pod', True)], 'NAMESPACE': [('namespace', True)], 'CLUSTER': [('cluster', True)], }), ] def __init__( self, obj_type=None, pod=None, namespace=None, cluster=None, start=None, end=None, ): """ :type obj_type: :class:`TimeSeries.Spec.ObjType` :param obj_type: Type of statistics object that the request is operating on. :type pod: :class:`TimeSeries.PodIdentifier` :param pod: Pod Identifier for queries on an individual pod. This attribute is optional and it is only relevant when the value of ``objType`` is :attr:`TimeSeries.Spec.ObjType.POD`. :type namespace: :class:`str` :param namespace: Namespace name for queries for a namespace. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.vcenter.namespaces.Instance``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.vcenter.namespaces.Instance``. This attribute is optional and it is only relevant when the value of ``objType`` is :attr:`TimeSeries.Spec.ObjType.NAMESPACE`. :type cluster: :class:`str` :param cluster: Cluster identifier for queries for a cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``ClusterComputeResource``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``ClusterComputeResource``. This attribute is optional and it is only relevant when the value of ``objType`` is :attr:`TimeSeries.Spec.ObjType.CLUSTER`. :type start: :class:`long` :param start: UNIX timestamp value indicating when the requested series of statistical samples should begin. https://en.wikipedia.org/wiki/Unix_time :type end: :class:`long` :param end: UNIX timestamp value indicating when the requested series of statistical samples should end. https://en.wikipedia.org/wiki/Unix_time """ self.obj_type = obj_type self.pod = pod self.namespace = namespace self.cluster = cluster self.start = start self.end = end VapiStruct.__init__(self) class ObjType(Enum): """ Type of statistics object that this request is operating on. .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ CLUSTER = None """ The CLUSTER object type is used when specifying a vSphere cluster. """ NAMESPACE = None """ The NAMESPACE object type is used to specify a namespace. """ POD = None """ The POD object type is used to specify an individual pod within a namespace. """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`ObjType` instance. """ Enum.__init__(string) ObjType._set_values([ ObjType('CLUSTER'), ObjType('NAMESPACE'), ObjType('POD'), ]) ObjType._set_binding_type( type.EnumType( 'com.vmware.vcenter.namespace_management.stats.time_series.spec.obj_type', ObjType)) Spec._set_binding_type( type.StructType( 'com.vmware.vcenter.namespace_management.stats.time_series.spec', { 'obj_type': type.ReferenceType(__name__, 'TimeSeries.Spec.ObjType'), 'pod': type.OptionalType( type.ReferenceType(__name__, 'TimeSeries.PodIdentifier')), 'namespace': type.OptionalType(type.IdType()), 'cluster': type.OptionalType(type.IdType()), 'start': type.IntegerType(), 'end': type.IntegerType(), }, Spec, False, None)) def get( self, spec, ): """ Gather statistical values for a cluster, namespace, or pod. :type spec: :class:`TimeSeries.Spec` :param spec: Specification of the statistical values that should be returned. :rtype: :class:`list` of :class:`TimeSeries.TimeSeries` :return: A list of TimeSeries values for each counter specified in the request. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if the system reports an error while responding to the request. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the start time in :attr:`TimeSeries.Spec.start` is invalid, or the end time in :attr:`TimeSeries.Spec.end` is invalid. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the specified cluster in :attr:`TimeSeries.Spec.cluster` or the namespace in :attr:`TimeSeries.Spec.namespace` or :attr:`TimeSeries.Spec.pod` does not exist. :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` if the specified cluster in :attr:`TimeSeries.Spec.cluster` is not enabled for Namespaces. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if the user does not have System.Read privilege. """ return self._invoke('get', { 'spec': spec, })
class Ipv6(VapiInterface): """ The ``Ipv6`` class provides methods to perform IPv6 network configuration for interfaces. This class was added in vSphere API 6.7. """ _VAPI_SERVICE_ID = 'com.vmware.appliance.networking.interfaces.ipv6' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _Ipv6Stub) self._VAPI_OPERATION_IDS = {} class Origin(Enum): """ The ``Ipv6.Origin`` class defines IPv6 address origin values. This enumeration was added in vSphere API 6.7. .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ DHCP = None """ The IPv6 address is assigned by a DHCP server. See RFC 4293. This class attribute was added in vSphere API 6.7. """ RANDOM = None """ The IPv6 address is assigned randomly by the system. See RFC 4293. This class attribute was added in vSphere API 6.7. """ MANUAL = None """ The IPv6 address was manually configured to a specified address, for example, by user configuration. See RFC 4293. This class attribute was added in vSphere API 6.7. """ LINKLAYER = None """ The IPv6 address is assigned by IPv6 Stateless Address Auto-configuration (SLAAC). See RFC 4293. This class attribute was added in vSphere API 6.7. """ OTHER = None """ The IPv6 address is assigned by a mechanism other than manual, DHCP, SLAAC, or random. See RFC 4293. This class attribute was added in vSphere API 6.7. """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`Origin` instance. """ Enum.__init__(string) Origin._set_values([ Origin('DHCP'), Origin('RANDOM'), Origin('MANUAL'), Origin('LINKLAYER'), Origin('OTHER'), ]) Origin._set_binding_type(type.EnumType( 'com.vmware.appliance.networking.interfaces.ipv6.origin', Origin)) class Status(Enum): """ The ``Ipv6.Status`` class defines IPv6 address status values. See RFC 4293. This enumeration was added in vSphere API 6.7. .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ TENTATIVE = None """ The IPv6 address is in the process of being verified as unique. An address in this state cannot be used for general communication. It can be used to determine the uniqueness of the address. This class attribute was added in vSphere API 6.7. """ UNKNOWN = None """ The status of this address cannot be determined. This class attribute was added in vSphere API 6.7. """ INACCESSIBLE = None """ The IPv6 address is inaccessible because the interface to which this address is assigned is not operational. This class attribute was added in vSphere API 6.7. """ INVALID = None """ The IPv6 address is not a valid address. It should not appear as the destination or source address of a packet. This class attribute was added in vSphere API 6.7. """ DUPLICATE = None """ The IPv6 address is not unique on the link and cannot be used. This class attribute was added in vSphere API 6.7. """ PREFERRED = None """ This is a valid IPv6 address that can appear as the destination or source address of a packet. This class attribute was added in vSphere API 6.7. """ DEPRECATED = None """ The is a valid but deprecated IPv6 address. This address cannot be used as a source address in new communications, although packets addressed to such an address are processed as expected. This class attribute was added in vSphere API 6.7. """ OPTIMISTIC = None """ The IPv6 address is available for use, subject to restrictions, while its uniqueness on a link is being verified. This class attribute was added in vSphere API 6.7. """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`Status` instance. """ Enum.__init__(string) Status._set_values([ Status('TENTATIVE'), Status('UNKNOWN'), Status('INACCESSIBLE'), Status('INVALID'), Status('DUPLICATE'), Status('PREFERRED'), Status('DEPRECATED'), Status('OPTIMISTIC'), ]) Status._set_binding_type(type.EnumType( 'com.vmware.appliance.networking.interfaces.ipv6.status', Status)) class Address(VapiStruct): """ The ``Ipv6.Address`` class provides the structure used to name an IPv6 address. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__(self, address=None, prefix=None, ): """ :type address: :class:`str` :param address: The IPv6 address, for example, fc00:10:20:83:20c:29ff:fe94:bb5a. This attribute was added in vSphere API 6.7. :type prefix: :class:`long` :param prefix: The IPv6 CIDR prefix, for example, 64. This attribute was added in vSphere API 6.7. """ self.address = address self.prefix = prefix VapiStruct.__init__(self) Address._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv6.address', { 'address': type.StringType(), 'prefix': type.IntegerType(), }, Address, False, None)) class AddressInfo(VapiStruct): """ The ``Ipv6.AddressInfo`` class provides the structure that you can use to get information about an IPv6 address along with its origin and status. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__(self, origin=None, status=None, address=None, prefix=None, ): """ :type origin: :class:`Ipv6.Origin` :param origin: The Origin of the IPv6 address. For more information, see RFC 4293. This attribute was added in vSphere API 6.7. :type status: :class:`Ipv6.Status` :param status: The Status of the IPv6 address. For more information, see RFC 4293. This attribute was added in vSphere API 6.7. :type address: :class:`str` :param address: The IPv6 address, for example, fc00:10:20:83:20c:29ff:fe94:bb5a. This attribute was added in vSphere API 6.7. :type prefix: :class:`long` :param prefix: The IPv6 CIDR prefix, for example, 64. This attribute was added in vSphere API 6.7. """ self.origin = origin self.status = status self.address = address self.prefix = prefix VapiStruct.__init__(self) AddressInfo._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv6.address_info', { 'origin': type.ReferenceType(__name__, 'Ipv6.Origin'), 'status': type.ReferenceType(__name__, 'Ipv6.Status'), 'address': type.StringType(), 'prefix': type.IntegerType(), }, AddressInfo, False, None)) class Config(VapiStruct): """ The ``Ipv6.Config`` class provides the structure that you can use to configure IPv6 on a particular interface. Addresses can be assigned by DHCP, SLAAC or STATIC, as IPv6 permits multiple addresses per interface. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__(self, dhcp=None, autoconf=None, addresses=None, default_gateway=None, ): """ :type dhcp: :class:`bool` :param dhcp: An address will be assigned by a DHCP server. This attribute was added in vSphere API 6.7. :type autoconf: :class:`bool` :param autoconf: An address will be assigned by Stateless Address Autoconfiguration (SLAAC). This attribute was added in vSphere API 6.7. :type addresses: :class:`list` of :class:`Ipv6.Address` :param addresses: The list of addresses to be statically assigned. This attribute was added in vSphere API 6.7. :type default_gateway: :class:`str` :param default_gateway: The default gateway for static IP address assignment. This configures the global IPv6 default gateway on the appliance with the specified gateway address and interface. This gateway replaces the existing default gateway configured on the appliance. However, if the gateway address is link-local, then it is added for that interface. This does not support configuration of multiple global default gateways through different interfaces. This attribute was added in vSphere API 6.7. """ self.dhcp = dhcp self.autoconf = autoconf self.addresses = addresses self.default_gateway = default_gateway VapiStruct.__init__(self) Config._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv6.config', { 'dhcp': type.BooleanType(), 'autoconf': type.BooleanType(), 'addresses': type.ListType(type.ReferenceType(__name__, 'Ipv6.Address')), 'default_gateway': type.StringType(), }, Config, False, None)) class Info(VapiStruct): """ The ``Ipv6.Info`` class provides the structure that defines an existing IPv6 configuration on a particular interface. This structure is read only. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__(self, dhcp=None, autoconf=None, addresses=None, default_gateway=None, configurable=None, ): """ :type dhcp: :class:`bool` :param dhcp: DHCP is on. This attribute was added in vSphere API 6.7. :type autoconf: :class:`bool` :param autoconf: Stateless Address Autoconfiguration (SLAAC) is on. This attribute was added in vSphere API 6.7. :type addresses: :class:`list` of :class:`Ipv6.AddressInfo` :param addresses: List of addresses with their origins and statuses. This attribute was added in vSphere API 6.7. :type default_gateway: :class:`str` :param default_gateway: The default gateway for static IP address assignment. This configures the global IPv6 default gateway on the appliance with the specified gateway address and interface. This gateway replaces the existing default gateway configured on the appliance. However, if the gateway address is link-local, then it is added for that interface. This does not support configuration of multiple global default gateways through different interfaces. This attribute was added in vSphere API 6.7. :type configurable: :class:`bool` :param configurable: Is NIC configurable or not. This attribute was added in vSphere API 6.7. """ self.dhcp = dhcp self.autoconf = autoconf self.addresses = addresses self.default_gateway = default_gateway self.configurable = configurable VapiStruct.__init__(self) Info._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv6.info', { 'dhcp': type.BooleanType(), 'autoconf': type.BooleanType(), 'addresses': type.ListType(type.ReferenceType(__name__, 'Ipv6.AddressInfo')), 'default_gateway': type.StringType(), 'configurable': type.BooleanType(), }, Info, False, None)) def set(self, interface_name, config, ): """ Set IPv6 network configuration for specific interface. This method was added in vSphere API 6.7. :type interface_name: :class:`str` :param interface_name: Network interface to update, for example, "nic0". The parameter must be an identifier for the resource type: ``com.vmware.appliance.networking.interfaces``. :type config: :class:`Ipv6.Config` :param config: The IPv6 configuration. :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` The specified NIC is busy. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` The specified NIC is not found. :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error. """ return self._invoke('set', { 'interface_name': interface_name, 'config': config, }) def get(self, interface_name, ): """ Get IPv6 network configuration for specific interface. This method was added in vSphere API 6.7. :type interface_name: :class:`str` :param interface_name: Network interface to query, for example, "nic0". The parameter must be an identifier for the resource type: ``com.vmware.appliance.networking.interfaces``. :rtype: :class:`Ipv6.Info` :return: IPv6 configuration. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the specified NIC is not found. :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error. """ return self._invoke('get', { 'interface_name': interface_name, })
def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'nsgroup_id': type.StringType(), 'service_type': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'fetch_parentgroup_associations': type.OptionalType(type.BooleanType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [HasFieldsOfValidator()] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/ns-groups/{nsgroup-id}/service-associations', path_variables={ 'nsgroup_id': 'nsgroup-id', }, query_parameters={ 'service_type': 'service_type', 'cursor': 'cursor', 'fetch_parentgroup_associations': 'fetch_parentgroup_associations', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json') operations = { 'list': { 'input_type': list_input_type, 'output_type': type.DynamicStructType( 'vmware.vapi.dynamic_struct', {}, VapiStruct, [ type.ReferenceType('com.vmware.nsx.model_client', 'ServiceAssociationListResult') ]), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.ns_groups.service_associations', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
class Storage(VapiInterface): """ ``Storage`` class provides methods Appliance storage configuration """ _VAPI_SERVICE_ID = 'com.vmware.appliance.system.storage' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _StorageStub) self._VAPI_OPERATION_IDS = {} class StorageMapping(VapiStruct): """ The ``Storage.StorageMapping`` class describes the mapping between VCSA partitions and the Hard disk numbers visible in the vSphere Web Client. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, disk=None, partition=None, description=None, ): """ :type disk: :class:`str` :param disk: The disk number in the vSphere Web Client. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.appliance.system.storage``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.appliance.system.storage``. :type partition: :class:`str` :param partition: Storage partition name. :type description: :class:`com.vmware.vapi.std_client.LocalizableMessage` :param description: Description of partition. This attribute was added in vSphere API 6.7. This attribute is optional because it was added in a newer version than its parent node. """ self.disk = disk self.partition = partition self.description = description VapiStruct.__init__(self) StorageMapping._set_binding_type( type.StructType( 'com.vmware.appliance.system.storage.storage_mapping', { 'disk': type.IdType( resource_types='com.vmware.appliance.system.storage'), 'partition': type.StringType(), 'description': type.OptionalType( type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')), }, StorageMapping, False, None)) class StorageChange(VapiStruct): """ The ``Storage.StorageChange`` class describes the changes in capasity of a storage partition. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, old_size=None, new_size=None, ): """ :type old_size: :class:`long` :param old_size: Original size of the partition in MB. This attribute was added in vSphere API 6.7. :type new_size: :class:`long` :param new_size: Nedw size of the partition in MB. This attribute was added in vSphere API 6.7. """ self.old_size = old_size self.new_size = new_size VapiStruct.__init__(self) StorageChange._set_binding_type( type.StructType('com.vmware.appliance.system.storage.storage_change', { 'old_size': type.IntegerType(), 'new_size': type.IntegerType(), }, StorageChange, False, None)) def list(self): """ Get disk to partition mapping. :rtype: :class:`list` of :class:`Storage.StorageMapping` :return: list of mapping items :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error """ return self._invoke('list', None) def resize(self): """ Resize all partitions to 100 percent of disk size. :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error """ return self._invoke('resize', None) def resize_ex(self): """ Resize all partitions to 100 percent of disk size. This method was added in vSphere API 6.7. :rtype: :class:`dict` of :class:`str` and :class:`Storage.StorageChange` :return: List of the partitions with the size before and after resizing :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error """ return self._invoke('resize_ex', None)
def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', { 'org': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vmc/api/orgs/{org}', path_variables={ 'org': 'org', }, query_parameters={}) # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } list_input_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vmc/api/orgs', path_variables={}, query_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.vmc.model_client', 'Organization'), 'errors': get_error_dict, 'input_validator_list': get_input_validator_list, 'output_validator_list': get_output_validator_list, }, 'list': { 'input_type': list_input_type, 'output_type': type.ListType( type.ReferenceType('com.vmware.vmc.model_client', 'Organization')), 'errors': list_error_dict, 'input_validator_list': list_input_validator_list, 'output_validator_list': list_output_validator_list, }, } rest_metadata = { 'get': get_rest_metadata, 'list': list_rest_metadata, } ApiInterfaceStub.__init__(self, iface_name='com.vmware.vmc.orgs', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for delete operation delete_input_type = type.StructType( 'operation-input', { 'service_id': type.StringType(), 'service_instance_id': type.StringType(), }) delete_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } delete_input_value_validator_list = [] delete_output_validator_list = [] delete_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=delete', path_variables={ 'service_id': 'service-id', 'service_instance_id': 'service-instance-id', }, query_parameters={}, content_type='application/json') # properties for deploy operation deploy_input_type = type.StructType( 'operation-input', { 'service_id': type.StringType(), 'service_instance_id': type.StringType(), }) deploy_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } deploy_input_value_validator_list = [] deploy_output_validator_list = [] deploy_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=deploy', path_variables={ 'service_id': 'service-id', 'service_instance_id': 'service-instance-id', }, query_parameters={}, content_type='application/json') # properties for list operation list_input_type = type.StructType( 'operation-input', { 'service_id': type.StringType(), 'service_instance_id': type.StringType(), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes', path_variables={ 'service_id': 'service-id', 'service_instance_id': 'service-instance-id', }, query_parameters={}, content_type='application/json') # properties for upgrade operation upgrade_input_type = type.StructType( 'operation-input', { 'service_id': type.StringType(), 'service_instance_id': type.StringType(), }) upgrade_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } upgrade_input_value_validator_list = [] upgrade_output_validator_list = [] upgrade_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=upgrade', path_variables={ 'service_id': 'service-id', 'service_instance_id': 'service-instance-id', }, query_parameters={}, content_type='application/json') operations = { 'delete': { 'input_type': delete_input_type, 'output_type': type.VoidType(), 'errors': delete_error_dict, 'input_value_validator_list': delete_input_value_validator_list, 'output_validator_list': delete_output_validator_list, 'task_type': TaskType.NONE, }, 'deploy': { 'input_type': deploy_input_type, 'output_type': type.VoidType(), 'errors': deploy_error_dict, 'input_value_validator_list': deploy_input_value_validator_list, 'output_validator_list': deploy_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceRuntimeListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, 'upgrade': { 'input_type': upgrade_input_type, 'output_type': type.VoidType(), 'errors': upgrade_error_dict, 'input_value_validator_list': upgrade_input_value_validator_list, 'output_validator_list': upgrade_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'delete': delete_rest_metadata, 'deploy': deploy_rest_metadata, 'list': list_rest_metadata, 'upgrade': upgrade_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', { 'org': type.StringType(), 'sddc': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/vmc/api/orgs/{org}/sddcs/{sddc}/networking/connectivity-tests', path_variables={ 'org': 'org', 'sddc': 'sddc', }, query_parameters={}, content_type='application/json') # properties for post operation post_input_type = type.StructType( 'operation-input', { 'org': type.StringType(), 'sddc': type.StringType(), 'request_info': type.ReferenceType('com.vmware.vmc.model_client', 'ConnectivityValidationGroup'), 'action': type.StringType(), }) post_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } post_input_value_validator_list = [] post_output_validator_list = [] post_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/vmc/api/orgs/{org}/sddcs/{sddc}/networking/connectivity-tests', request_body_parameter='request_info', path_variables={ 'org': 'org', 'sddc': 'sddc', }, query_parameters={ 'action': 'action', }, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.vmc.model_client', 'ConnectivityValidationGroups'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'post': { 'input_type': post_input_type, 'output_type': type.ReferenceType('com.vmware.vmc.model_client', 'Task'), 'errors': post_error_dict, 'input_value_validator_list': post_input_value_validator_list, 'output_validator_list': post_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, 'post': post_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.vmc.orgs.sddcs.networking.connectivity_tests', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'session_timer_profile_id': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'include_mark_for_delete_objects': type.OptionalType(type.BooleanType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [ ] list_output_validator_list = [ HasFieldsOfValidator() ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/policy/api/v1/infra/session-timer-profiles/{session-timer-profile-id}/bindings', path_variables={ 'session_timer_profile_id': 'session-timer-profile-id', }, query_parameters={ 'cursor': 'cursor', 'include_mark_for_delete_objects': 'include_mark_for_delete_objects', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json' ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'SessionTimerProfileBindingListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx_policy.infra.session_timer_profiles.bindings', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
self.groups = groups VapiStruct.__init__(self) InvocationRequest._set_binding_type( type.StructType( 'com.vmware.vapi.std.interposition.invocation_request', { 'service_id': type.StringType(), 'operation_id': type.StringType(), 'operation_input': type.OpaqueType(), 'user': type.OptionalType( type.ReferenceType(sys.modules[__name__], 'SecurityPrincipal')), 'groups': type.ListType( type.ReferenceType(sys.modules[__name__], 'SecurityPrincipal')), }, InvocationRequest, False, None)) class InvocationResult(VapiStruct): """ Information about the result from an interposed operation invocation. All POST interposers will receive an instance of this structure. .. tip:: The arguments are used to initialize data attributes with the same names.
self.severity = severity self.issue_type = issue_type self.target_object_name = target_object_name self.fault = fault self.triggered_time = triggered_time VapiStruct.__init__(self) HmsIssueInfo._set_binding_type( type.StructType( 'com.vmware.vmc.draas.model.hms_issue_info', { 'target_object_mo_id': type.StringType(), 'severity': type.StringType(), 'issue_type': type.StringType(), 'target_object_name': type.OptionalType(type.StringType()), 'fault': type.OptionalType(type.ReferenceType(__name__, 'Fault')), 'triggered_time': type.DateTimeType(), }, HmsIssueInfo, False, None)) class HmsReplicationIssueInfo(VapiStruct): """ .. tip:: The arguments are used to initialize data attributes with the same names. """ _canonical_to_pep_names = { 'target_object_mo_id': 'target_object_mo_id',
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/appliance/system/storage', path_variables={}, query_parameters={}) # properties for resize operation resize_input_type = type.StructType('operation-input', {}) resize_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } resize_input_value_validator_list = [] resize_output_validator_list = [] resize_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/appliance/system/storage/resize', path_variables={}, query_parameters={}) # properties for resize_ex operation resize_ex_input_type = type.StructType('operation-input', {}) resize_ex_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } resize_ex_input_value_validator_list = [] resize_ex_output_validator_list = [] resize_ex_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/appliance/system/storage?action=resize-ex', path_variables={}, query_parameters={}) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType( type.ReferenceType(__name__, 'Storage.StorageMapping')), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, 'resize': { 'input_type': resize_input_type, 'output_type': type.VoidType(), 'errors': resize_error_dict, 'input_value_validator_list': resize_input_value_validator_list, 'output_validator_list': resize_output_validator_list, 'task_type': TaskType.NONE, }, 'resize_ex': { 'input_type': resize_ex_input_type, 'output_type': type.MapType( type.StringType(), type.ReferenceType(__name__, 'Storage.StorageChange')), 'errors': resize_ex_error_dict, 'input_value_validator_list': resize_ex_input_value_validator_list, 'output_validator_list': resize_ex_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, 'resize': resize_rest_metadata, 'resize_ex': resize_ex_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.appliance.system.storage', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'spec': type.ReferenceType(__name__, 'TimeSeries.Spec'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unsupported': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/namespace-management/stats/time-series', path_variables={}, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ListType( type.ReferenceType(__name__, 'TimeSeries.TimeSeries')), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.vcenter.namespace_management.stats.time_series', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'tier0_id': type.StringType(), 'enforcement_point_path': type.OptionalType(type.StringType()), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [HasFieldsOfValidator()] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/dns-forwarder/status', path_variables={ 'tier0_id': 'tier-0-id', }, query_parameters={ 'enforcement_point_path': 'enforcement_point_path', }, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'AggregateDNSForwarderStatus'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx_policy.global_infra.tier_0s.dns_forwarder.status', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'enforcement_point_name': type.StringType(), 'nsservice_name': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/infra/realized-state/enforcement-points/{enforcement-point-name}/services/nsservices/{nsservice-name}', path_variables={ 'enforcement_point_name': 'enforcement-point-name', 'nsservice_name': 'nsservice-name', }, query_parameters={}, content_type='application/json') # properties for list operation list_input_type = type.StructType( 'operation-input', { 'enforcement_point_name': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/infra/realized-state/enforcement-points/{enforcement-point-name}/services/nsservices', path_variables={ 'enforcement_point_name': 'enforcement-point-name', }, query_parameters={ 'cursor': 'cursor', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'GenericPolicyRealizedResource'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'GenericPolicyRealizedResourceListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx_policy.infra.realized_state.enforcement_points.services.nsservices', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'domain_id': type.StringType(), 'group_id': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'enforcement_point_path': type.OptionalType(type.StringType()), 'include_mark_for_delete_objects': type.OptionalType(type.BooleanType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/policy/api/v1/infra/domains/{domain-id}/groups/{group-id}/members/virtual-machines', path_variables={ 'domain_id': 'domain-id', 'group_id': 'group-id', }, query_parameters={ 'cursor': 'cursor', 'enforcement_point_path': 'enforcement_point_path', 'include_mark_for_delete_objects': 'include_mark_for_delete_objects', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json' ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RealizedVirtualMachineListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx_policy.infra.domains.groups.members.virtual_machines', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
class Ipv4(VapiInterface): """ The ``Ipv4`` class provides methods to perform IPv4 network configuration for interfaces. This class was added in vSphere API 6.7. """ _VAPI_SERVICE_ID = 'com.vmware.appliance.networking.interfaces.ipv4' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _Ipv4Stub) self._VAPI_OPERATION_IDS = {} class Mode(Enum): """ The ``Ipv4.Mode`` class defines different IPv4 address assignment modes. This enumeration was added in vSphere API 6.7. .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ DHCP = None """ The IPv4 address is automatically assigned by a DHCP server. This class attribute was added in vSphere API 6.7. """ STATIC = None """ The IPv4 address is static. This class attribute was added in vSphere API 6.7. """ UNCONFIGURED = None """ The IPv4 protocol is not configured. This class attribute was added in vSphere API 6.7. """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`Mode` instance. """ Enum.__init__(string) Mode._set_values([ Mode('DHCP'), Mode('STATIC'), Mode('UNCONFIGURED'), ]) Mode._set_binding_type(type.EnumType( 'com.vmware.appliance.networking.interfaces.ipv4.mode', Mode)) class Config(VapiStruct): """ The ``Ipv4.Config`` class provides defines the IPv4 configuration of a network interface. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ _validator_list = [ UnionValidator( 'mode', { 'STATIC' : [('address', True), ('prefix', True)], 'DHCP' : [], 'UNCONFIGURED' : [], } ), ] def __init__(self, mode=None, address=None, prefix=None, default_gateway=None, ): """ :type mode: :class:`Ipv4.Mode` :param mode: The Address assignment mode. This attribute was added in vSphere API 6.7. :type address: :class:`str` :param address: The IPv4 address, for example, "10.20.80.191". This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of ``mode`` is :attr:`Ipv4.Mode.STATIC`. :type prefix: :class:`long` :param prefix: The IPv4 CIDR prefix, for example, 24. See http://www.oav.net/mirrors/cidr.html for netmask-to-prefix conversion. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of ``mode`` is :attr:`Ipv4.Mode.STATIC`. :type default_gateway: :class:`str` or ``None`` :param default_gateway: The IPv4 address of the default gateway. This configures the global default gateway on the appliance with the specified gateway address and interface. This gateway replaces the existing default gateway configured on the appliance. However, if the gateway address is link-local, then it is added for that interface. This does not support configuration of multiple global default gateways through different interfaces. This attribute was added in vSphere API 6.7. If None, the defaultGateway was never set. """ self.mode = mode self.address = address self.prefix = prefix self.default_gateway = default_gateway VapiStruct.__init__(self) Config._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv4.config', { 'mode': type.ReferenceType(__name__, 'Ipv4.Mode'), 'address': type.OptionalType(type.StringType()), 'prefix': type.OptionalType(type.IntegerType()), 'default_gateway': type.OptionalType(type.StringType()), }, Config, False, None)) class Info(VapiStruct): """ The ``Ipv4.Info`` class defines current IPv4 configuration state of a network interface. This class was added in vSphere API 6.7. .. tip:: The arguments are used to initialize data attributes with the same names. """ _validator_list = [ UnionValidator( 'mode', { 'STATIC' : [('address', True), ('prefix', True), ('default_gateway', True)], 'DHCP' : [('address', True), ('prefix', True), ('default_gateway', True)], 'UNCONFIGURED' : [], } ), ] def __init__(self, configurable=None, mode=None, address=None, prefix=None, default_gateway=None, ): """ :type configurable: :class:`bool` :param configurable: The specified network interface is configurable or not. This attribute was added in vSphere API 6.7. :type mode: :class:`Ipv4.Mode` :param mode: The Address assignment mode. This attribute was added in vSphere API 6.7. :type address: :class:`str` :param address: The IPv4 address, for example, "10.20.80.191". This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of ``mode`` is one of :attr:`Ipv4.Mode.STATIC` or :attr:`Ipv4.Mode.DHCP`. :type prefix: :class:`long` :param prefix: The IPv4 CIDR prefix, for example, 24. See http://www.oav.net/mirrors/cidr.html for netmask-to-prefix conversion. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of ``mode`` is one of :attr:`Ipv4.Mode.STATIC` or :attr:`Ipv4.Mode.DHCP`. :type default_gateway: :class:`str` :param default_gateway: The IPv4 address of the default gateway. This configures the global default gateway on the appliance with the specified gateway address and interface. This gateway replaces the existing default gateway configured on the appliance. However, if the gateway address is link-local, then it is added for that interface. This does not support configuration of multiple global default gateways through different interfaces. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of ``mode`` is one of :attr:`Ipv4.Mode.STATIC` or :attr:`Ipv4.Mode.DHCP`. """ self.configurable = configurable self.mode = mode self.address = address self.prefix = prefix self.default_gateway = default_gateway VapiStruct.__init__(self) Info._set_binding_type(type.StructType( 'com.vmware.appliance.networking.interfaces.ipv4.info', { 'configurable': type.BooleanType(), 'mode': type.ReferenceType(__name__, 'Ipv4.Mode'), 'address': type.OptionalType(type.StringType()), 'prefix': type.OptionalType(type.IntegerType()), 'default_gateway': type.OptionalType(type.StringType()), }, Info, False, None)) def set(self, interface_name, config, ): """ Set IPv4 network configuration for specific network interface. This method was added in vSphere API 6.7. :type interface_name: :class:`str` :param interface_name: Network interface to update, for example, "nic0". The parameter must be an identifier for the resource type: ``com.vmware.appliance.networking.interfaces``. :type config: :class:`Ipv4.Config` :param config: The IPv4 Network configuration to set. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the specified NIC is not found. :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` if the IP is used as PNID :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` if the specified NIC is busy. :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error. """ return self._invoke('set', { 'interface_name': interface_name, 'config': config, }) def get(self, interface_name, ): """ Get IPv4 network configuration for specific NIC. This method was added in vSphere API 6.7. :type interface_name: :class:`str` :param interface_name: The Network interface to query, for example, "nic0". The parameter must be an identifier for the resource type: ``com.vmware.appliance.networking.interfaces``. :rtype: :class:`Ipv4.Info` :return: The IPv4 configuration for the queried NIC. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the specified NIC is not found. :raise: :class:`com.vmware.vapi.std.errors_client.Error` Generic error. """ return self._invoke('get', { 'interface_name': interface_name, })
class Nodes(VapiInterface): """ The ``Nodes`` interface provides methods to retrieve vCenter and Platform Services Controller nodes information in the topology. This class was added in vSphere API 6.7.2. """ _VAPI_SERVICE_ID = 'com.vmware.vcenter.topology.nodes' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _NodesStub) self._VAPI_OPERATION_IDS = {} class ApplianceType(Enum): """ The ``Nodes.ApplianceType`` class defines values for valid appliance types for the vCenter and Platform Services Controller node. See :class:`Nodes.Info`. This enumeration was added in vSphere API 6.7.2. .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ VCSA_EMBEDDED = None """ vCenter Server Appliance with an embedded Platform Services Controller. This class attribute was added in vSphere API 6.7.2. """ VCSA_EXTERNAL = None """ vCenter Server Appliance with an external Platform Services Controller. This class attribute was added in vSphere API 6.7.2. """ PSC_EXTERNAL = None """ An external Platform Services Controller. This class attribute was added in vSphere API 6.7.2. """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`ApplianceType` instance. """ Enum.__init__(string) ApplianceType._set_values([ ApplianceType('VCSA_EMBEDDED'), ApplianceType('VCSA_EXTERNAL'), ApplianceType('PSC_EXTERNAL'), ]) ApplianceType._set_binding_type(type.EnumType( 'com.vmware.vcenter.topology.nodes.appliance_type', ApplianceType)) class Info(VapiStruct): """ The ``Nodes.Info`` class contains vCenter or Platform Services Controller node details. This class was added in vSphere API 6.7.2. .. tip:: The arguments are used to initialize data attributes with the same names. """ _validator_list = [ UnionValidator( 'type', { 'VCSA_EMBEDDED' : [('replication_partners', True)], 'PSC_EXTERNAL' : [('replication_partners', True)], 'VCSA_EXTERNAL' : [('client_affinity', True)], } ), ] def __init__(self, domain=None, type=None, replication_partners=None, client_affinity=None, ): """ :type domain: :class:`str` :param domain: Domain name of the node. This attribute was added in vSphere API 6.7.2. :type type: :class:`Nodes.ApplianceType` :param type: Appliance type of the node. This attribute was added in vSphere API 6.7.2. :type replication_partners: :class:`list` of :class:`str` :param replication_partners: List of replication partners' node identifiers. Identifiers can be either IP address or DNS resolvable name of the partner node. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type: ``com.vmware.vcenter.VCenter.name``. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type: ``com.vmware.vcenter.VCenter.name``. This attribute is optional and it is only relevant when the value of ``type`` is one of :attr:`Nodes.ApplianceType.VCSA_EMBEDDED` or :attr:`Nodes.ApplianceType.PSC_EXTERNAL`. :type client_affinity: :class:`str` :param client_affinity: Identifier of the affinitized Platform Services Controller node. Identifier can be either IP address or DNS resolvable name of the affinitized node. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. This attribute is optional and it is only relevant when the value of ``type`` is :attr:`Nodes.ApplianceType.VCSA_EXTERNAL`. """ self.domain = domain self.type = type self.replication_partners = replication_partners self.client_affinity = client_affinity VapiStruct.__init__(self) Info._set_binding_type(type.StructType( 'com.vmware.vcenter.topology.nodes.info', { 'domain': type.StringType(), 'type': type.ReferenceType(__name__, 'Nodes.ApplianceType'), 'replication_partners': type.OptionalType(type.ListType(type.IdType())), 'client_affinity': type.OptionalType(type.IdType()), }, Info, False, None)) class Summary(VapiStruct): """ The ``Nodes.Summary`` class contains commonly used information of vCenter or Platform Services Controller node. This class was added in vSphere API 6.7.2. .. tip:: The arguments are used to initialize data attributes with the same names. """ _validator_list = [ UnionValidator( 'type', { 'VCSA_EMBEDDED' : [('replication_partners', True)], 'PSC_EXTERNAL' : [('replication_partners', True)], 'VCSA_EXTERNAL' : [('client_affinity', True)], } ), ] def __init__(self, node=None, type=None, replication_partners=None, client_affinity=None, ): """ :type node: :class:`str` :param node: Identifier for the vCenter or Platform Services Controller node. Identifier can be either IP address or DNS resolvable name of the node. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. :type type: :class:`Nodes.ApplianceType` :param type: Appliance type of the node. This attribute was added in vSphere API 6.7.2. :type replication_partners: :class:`list` of :class:`str` :param replication_partners: List of replication partners' node identifiers. Identifiers can be either IP address or DNS resolvable name of the partner node. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type: ``com.vmware.vcenter.VCenter.name``. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type: ``com.vmware.vcenter.VCenter.name``. This attribute is optional and it is only relevant when the value of ``type`` is one of :attr:`Nodes.ApplianceType.VCSA_EMBEDDED` or :attr:`Nodes.ApplianceType.PSC_EXTERNAL`. :type client_affinity: :class:`str` :param client_affinity: Identifier of the affinitized Platform Services Controller node. Identifier can be either IP address or DNS resolvable name of the affinitized node. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. This attribute is optional and it is only relevant when the value of ``type`` is :attr:`Nodes.ApplianceType.VCSA_EXTERNAL`. """ self.node = node self.type = type self.replication_partners = replication_partners self.client_affinity = client_affinity VapiStruct.__init__(self) Summary._set_binding_type(type.StructType( 'com.vmware.vcenter.topology.nodes.summary', { 'node': type.IdType(resource_types='com.vmware.vcenter.VCenter.name'), 'type': type.ReferenceType(__name__, 'Nodes.ApplianceType'), 'replication_partners': type.OptionalType(type.ListType(type.IdType())), 'client_affinity': type.OptionalType(type.IdType()), }, Summary, False, None)) class FilterSpec(VapiStruct): """ The ``Nodes.FilterSpec`` class contains attribute used to filter the results when listing vCenter and Platform Services Controller nodes (see :func:`Nodes.list`). This class was added in vSphere API 6.7.2. .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__(self, types=None, ): """ :type types: :class:`set` of :class:`Nodes.ApplianceType` or ``None`` :param types: Types of the appliance that a vCenter and Platform Services Controller node must be to match the filter (see :class:`Nodes.ApplianceType`. This attribute was added in vSphere API 6.7.2. If None or empty, node of any ApplianceType match the filter. """ self.types = types VapiStruct.__init__(self) FilterSpec._set_binding_type(type.StructType( 'com.vmware.vcenter.topology.nodes.filter_spec', { 'types': type.OptionalType(type.SetType(type.ReferenceType(__name__, 'Nodes.ApplianceType'))), }, FilterSpec, False, None)) def list(self, filter=None, ): """ Returns information about all vCenter and Platform Services Controller nodes matching the :class:`Nodes.FilterSpec`. This method was added in vSphere API 6.7.2. :type filter: :class:`Nodes.FilterSpec` or ``None`` :param filter: Specification of matching vCenter and Platform Services Controller nodes for which information should be returned. If None, the behavior is equivalent to a :class:`Nodes.FilterSpec` with all attributes None which means all nodes match the filter. :rtype: :class:`list` of :class:`Nodes.Summary` :return: commonly used information for all vCenter and Platform Services Controller nodes matching the :class:`Nodes.FilterSpec`. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if the user doesn't have the required privileges. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the :attr:`Nodes.FilterSpec.types` attribute contains a value that is not supported. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if you do not have all of the privileges described as follows: * Method execution requires ``System.Read``. """ return self._invoke('list', { 'filter': filter, }) def get(self, node, ): """ Retrieve details for a given identifier of the vCenter or Platform Services Controller node. This method was added in vSphere API 6.7.2. :type node: :class:`str` :param node: Identifier of the vCenter or Platform Services Controller node. Identifier can be either IP address or DNS resolvable name of the node. The parameter must be an identifier for the resource type: ``com.vmware.vcenter.VCenter.name``. :rtype: :class:`Nodes.Info` :return: vCenter or Platform Services Controller node details with replication partners and client affinity information as applicable. See :class:`Nodes.Info`. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if the user doesn't have the required privileges. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if a node doesn't exist for given node identifier. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if you do not have all of the privileges described as follows: * Method execution requires ``System.Read``. """ return self._invoke('get', { 'node': node, })
def __init__(self, config): # properties for create operation create_input_type = type.StructType( 'operation-input', { 'add_cluster_node_VM_info': type.ReferenceType('com.vmware.nsx.model_client', 'AddClusterNodeVMInfo'), }) create_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } create_input_value_validator_list = [HasFieldsOfValidator()] create_output_validator_list = [HasFieldsOfValidator()] create_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/api/v1/cluster/nodes/deployments', request_body_parameter='add_cluster_node_VM_info', path_variables={}, query_parameters={}, content_type='application/json') # properties for delete operation delete_input_type = type.StructType( 'operation-input', { 'node_id': type.StringType(), 'force_delete': type.OptionalType(type.BooleanType()), }) delete_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } delete_input_value_validator_list = [] delete_output_validator_list = [] delete_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/api/v1/cluster/nodes/deployments/{node-id}?action=delete', path_variables={ 'node_id': 'node-id', }, query_parameters={ 'force_delete': 'force_delete', }, content_type='application/json') # properties for get operation get_input_type = type.StructType('operation-input', { 'node_id': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [HasFieldsOfValidator()] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/cluster/nodes/deployments/{node-id}', path_variables={ 'node_id': 'node-id', }, query_parameters={}, content_type='application/json') # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [HasFieldsOfValidator()] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/cluster/nodes/deployments', path_variables={}, query_parameters={}, content_type='application/json') operations = { 'create': { 'input_type': create_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ClusterNodeVMDeploymentRequestList'), 'errors': create_error_dict, 'input_value_validator_list': create_input_value_validator_list, 'output_validator_list': create_output_validator_list, 'task_type': TaskType.NONE, }, 'delete': { 'input_type': delete_input_type, 'output_type': type.VoidType(), 'errors': delete_error_dict, 'input_value_validator_list': delete_input_value_validator_list, 'output_validator_list': delete_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ClusterNodeVMDeploymentRequest'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ClusterNodeVMDeploymentRequestList'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'create': create_rest_metadata, 'delete': delete_rest_metadata, 'get': get_rest_metadata, 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.cluster.nodes.deployments', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'filter': type.OptionalType(type.ReferenceType(__name__, 'Nodes.FilterSpec')), }) list_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/topology/nodes', path_variables={ }, query_parameters={ } ) # properties for get operation get_input_type = type.StructType('operation-input', { 'node': type.IdType(resource_types='com.vmware.vcenter.VCenter.name'), }) get_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [ ] get_output_validator_list = [ ] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/topology/nodes/{node}', path_variables={ 'node': 'node', }, query_parameters={ } ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType(type.ReferenceType(__name__, 'Nodes.Summary')), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Nodes.Info'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.topology.nodes', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for delete operation delete_input_type = type.StructType( 'operation-input', { 'domain_id': type.StringType(), 'redirection_policy_id': type.StringType(), 'rule_id': type.StringType(), }) delete_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } delete_input_value_validator_list = [] delete_output_validator_list = [] delete_rest_metadata = OperationRestMetadata( http_method='DELETE', url_template= '/policy/api/v1/infra/domains/{domain-id}/redirection-policies/{redirection-policy-id}/rules/{rule-id}', path_variables={ 'domain_id': 'domain-id', 'redirection_policy_id': 'redirection-policy-id', 'rule_id': 'rule-id', }, query_parameters={}, content_type='application/json') # properties for get operation get_input_type = type.StructType( 'operation-input', { 'domain_id': type.StringType(), 'redirection_policy_id': type.StringType(), 'rule_id': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [HasFieldsOfValidator()] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/infra/domains/{domain-id}/redirection-policies/{redirection-policy-id}/rules/{rule-id}', path_variables={ 'domain_id': 'domain-id', 'redirection_policy_id': 'redirection-policy-id', 'rule_id': 'rule-id', }, query_parameters={}, content_type='application/json') # properties for list operation list_input_type = type.StructType( 'operation-input', { 'domain_id': type.StringType(), 'redirection_policy_id': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'include_mark_for_delete_objects': type.OptionalType(type.BooleanType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [HasFieldsOfValidator()] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/infra/domains/{domain-id}/redirection-policies/{redirection-policy-id}/rules', path_variables={ 'domain_id': 'domain-id', 'redirection_policy_id': 'redirection-policy-id', }, query_parameters={ 'cursor': 'cursor', 'include_mark_for_delete_objects': 'include_mark_for_delete_objects', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json') # properties for patch operation patch_input_type = type.StructType( 'operation-input', { 'domain_id': type.StringType(), 'redirection_policy_id': type.StringType(), 'rule_id': type.StringType(), 'redirection_rule': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RedirectionRule'), }) patch_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } patch_input_value_validator_list = [HasFieldsOfValidator()] patch_output_validator_list = [] patch_rest_metadata = OperationRestMetadata( http_method='PATCH', url_template= '/policy/api/v1/infra/domains/{domain-id}/redirection-policies/{redirection-policy-id}/rules/{rule-id}', request_body_parameter='redirection_rule', path_variables={ 'domain_id': 'domain-id', 'redirection_policy_id': 'redirection-policy-id', 'rule_id': 'rule-id', }, query_parameters={}, content_type='application/json') # properties for update operation update_input_type = type.StructType( 'operation-input', { 'domain_id': type.StringType(), 'redirection_policy_id': type.StringType(), 'rule_id': type.StringType(), 'redirection_rule': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RedirectionRule'), }) update_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } update_input_value_validator_list = [HasFieldsOfValidator()] update_output_validator_list = [HasFieldsOfValidator()] update_rest_metadata = OperationRestMetadata( http_method='PUT', url_template= '/policy/api/v1/infra/domains/{domain-id}/redirection-policies/{redirection-policy-id}/rules/{rule-id}', request_body_parameter='redirection_rule', path_variables={ 'domain_id': 'domain-id', 'redirection_policy_id': 'redirection-policy-id', 'rule_id': 'rule-id', }, query_parameters={}, content_type='application/json') operations = { 'delete': { 'input_type': delete_input_type, 'output_type': type.VoidType(), 'errors': delete_error_dict, 'input_value_validator_list': delete_input_value_validator_list, 'output_validator_list': delete_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RedirectionRule'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RedirectionRuleListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, 'patch': { 'input_type': patch_input_type, 'output_type': type.VoidType(), 'errors': patch_error_dict, 'input_value_validator_list': patch_input_value_validator_list, 'output_validator_list': patch_output_validator_list, 'task_type': TaskType.NONE, }, 'update': { 'input_type': update_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RedirectionRule'), 'errors': update_error_dict, 'input_value_validator_list': update_input_value_validator_list, 'output_validator_list': update_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'delete': delete_rest_metadata, 'get': get_rest_metadata, 'list': list_rest_metadata, 'patch': patch_rest_metadata, 'update': update_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx_policy.infra.domains.redirection_policies.rules', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', {}) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/api/v1/node/hardening-policy/mandatory-access-control', path_variables={}, query_parameters={}, content_type='application/json') # properties for update operation update_input_type = type.StructType( 'operation-input', { 'mandatory_access_control_properties': type.ReferenceType('com.vmware.nsx.model_client', 'MandatoryAccessControlProperties'), }) update_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } update_input_value_validator_list = [] update_output_validator_list = [] update_rest_metadata = OperationRestMetadata( http_method='PUT', url_template= '/api/v1/node/hardening-policy/mandatory-access-control', request_body_parameter='mandatory_access_control_properties', path_variables={}, query_parameters={}, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'MandatoryAccessControlProperties'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'update': { 'input_type': update_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'MandatoryAccessControlProperties'), 'errors': update_error_dict, 'input_value_validator_list': update_input_value_validator_list, 'output_validator_list': update_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, 'update': update_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx.node.hardening_policy.mandatory_access_control', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'tier0_id': type.StringType(), 'nat_id': type.StringType(), 'nat_rule_id': type.StringType(), 'enforcement_point_path': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/infra/tier-0s/{tier-0-id}/nat/{nat-id}/nat-rules/{nat-rule-id}/statistics', path_variables={ 'tier0_id': 'tier-0-id', 'nat_id': 'nat-id', 'nat_rule_id': 'nat-rule-id', }, query_parameters={ 'enforcement_point_path': 'enforcement_point_path', }, content_type='application/json') operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'PolicyNatRuleStatisticsListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx_policy.infra.tier_0s.nat.nat_rules.statistics', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'tier0_id': type.StringType(), 'locale_services_id': type.StringType(), 'cursor': type.OptionalType(type.StringType()), 'edge_path': type.OptionalType(type.StringType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-services-id}/inter-site/status', path_variables={ 'tier0_id': 'tier-0-id', 'locale_services_id': 'locale-services-id', }, query_parameters={ 'cursor': 'cursor', 'edge_path': 'edge_path', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', }, content_type='application/json') operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'PolicyEdgeClusterInterSiteStatus'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.nsx_policy.global_infra.tier_0s.locale_services.inter_site.status', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)
class Compliance(VapiInterface): """ The Compliance class provides methods related to all the associated entities of given compliance statuses. This class was added in vSphere API 6.7 """ def __init__(self, config): """ :type config: :class:`vmware.vapi.bindings.stub.StubConfiguration` :param config: Configuration to be used for creating the stub. """ VapiInterface.__init__(self, config, _ComplianceStub) class Status(Enum): """ This enumeration defines the set of status values for a compliance operation. This enumeration was added in vSphere API 6.7 .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See :ref:`enumerated type description page <enumeration_description>`. """ COMPLIANT = None """ Entity is in compliance. This class attribute was added in vSphere API 6.7 """ NON_COMPLIANT = None """ Entity is out of compliance. This class attribute was added in vSphere API 6.7 """ UNKNOWN = None """ Compliance status of the entity is not known. This class attribute was added in vSphere API 6.7 """ NOT_APPLICABLE = None """ Compliance computation is not applicable for this entity because it does not have any storage requirement that apply to the object-based datastore on which the entity is placed. This class attribute was added in vSphere API 6.7 """ OUT_OF_DATE = None """ Compliance status becomes out of date when the profile associated with the entity is edited and not applied. The compliance status will remain out of date until the latest policy is applied to the entity. This class attribute was added in vSphere API 6.7 """ def __init__(self, string): """ :type string: :class:`str` :param string: String value for the :class:`Status` instance. """ Enum.__init__(string) Status._set_values([ Status('COMPLIANT'), Status('NON_COMPLIANT'), Status('UNKNOWN'), Status('NOT_APPLICABLE'), Status('OUT_OF_DATE'), ]) Status._set_binding_type( type.EnumType('com.vmware.vcenter.storage.policies.compliance.status', Status)) class Summary(VapiStruct): """ Provides the details of a virtual machine and its associated entities which match the given compliance statuses. This class was added in vSphere API 6.7 .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, vm=None, vm_home=None, disks=None, ): """ :type vm: :class:`str` :param vm: Identifier of virtual machine. This attribute was added in vSphere API 6.7 When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ``VirtualMachine``. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ``VirtualMachine``. :type vm_home: :class:`Compliance.Status` or ``None`` :param vm_home: Compliance status of the virtual machine home. This attribute was added in vSphere API 6.7 If None or empty, vmHome is not associated with a storage policy. :type disks: (:class:`dict` of :class:`str` and :class:`Compliance.Status`) or ``None`` :param disks: List of the virtual hard disk. This attribute was added in vSphere API 6.7 When clients pass a value of this class as a parameter, the key in the attribute :class:`dict` must be an identifier for the resource type: ``com.vmware.vcenter.vm.hardware.Disk``. When methods return a value of this class as a return value, the key in the attribute :class:`dict` will be an identifier for the resource type: ``com.vmware.vcenter.vm.hardware.Disk``. If None or empty, virtual machine entity does not have any disks or its disks are not associated with a storage policy. """ self.vm = vm self.vm_home = vm_home self.disks = disks VapiStruct.__init__(self) Summary._set_binding_type( type.StructType( 'com.vmware.vcenter.storage.policies.compliance.summary', { 'vm': type.IdType(resource_types='VirtualMachine'), 'vm_home': type.OptionalType( type.ReferenceType(__name__, 'Compliance.Status')), 'disks': type.OptionalType( type.MapType( type.IdType(), type.ReferenceType(__name__, 'Compliance.Status'))), }, Summary, False, None)) class FilterSpec(VapiStruct): """ The ``Compliance.FilterSpec`` class contains complianceStatus used to filter the results when listing entities (see :func:`Compliance.list`). This class was added in vSphere API 6.7 .. tip:: The arguments are used to initialize data attributes with the same names. """ def __init__( self, status=None, ): """ :type status: :class:`set` of :class:`Compliance.Status` :param status: Compliance Status that a virtual machine must have to match the filter. This attribute was added in vSphere API 6.7 """ self.status = status VapiStruct.__init__(self) FilterSpec._set_binding_type( type.StructType( 'com.vmware.vcenter.storage.policies.compliance.filter_spec', { 'status': type.SetType(type.ReferenceType(__name__, 'Compliance.Status')), }, FilterSpec, False, None)) def list( self, filter, ): """ Returns compliance information about entities matching the filter :class:`Compliance.FilterSpec`. Entities without storage policy association are not returned. This method was added in vSphere API 6.7 :type filter: :class:`Compliance.FilterSpec` :param filter: compliance status of matching entities for which information should be returned. :rtype: :class:`list` of :class:`Compliance.Summary` :return: compliance information about entities matching the filter :class:`Compliance.FilterSpec`. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if the system reports an error while responding to the request. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the :attr:`Compliance.FilterSpec.status` attribute contains a value that is not supported by the server. :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` if the system is unable to communicate with a service to complete the request. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` if the user doesn't have the required privileges. """ return self._invoke('list', { 'filter': filter, })
def __init__(self, config): # properties for create operation create_input_type = type.StructType('operation-input', { 'start_app_discovery_session_parameters': type.ReferenceType('com.vmware.nsx.model_client', 'StartAppDiscoverySessionParameters'), }) create_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } create_input_value_validator_list = [ ] create_output_validator_list = [ ] create_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/api/v1/app-discovery/sessions', request_body_parameter='start_app_discovery_session_parameters', path_variables={ }, query_parameters={ }, content_type='application/json' ) # properties for delete operation delete_input_type = type.StructType('operation-input', { 'session_id': type.StringType(), }) delete_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } delete_input_value_validator_list = [ ] delete_output_validator_list = [ ] delete_rest_metadata = OperationRestMetadata( http_method='DELETE', url_template='/api/v1/app-discovery/sessions/{session-id}', path_variables={ 'session_id': 'session-id', }, query_parameters={ }, content_type='application/json' ) # properties for get operation get_input_type = type.StructType('operation-input', { 'session_id': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [ ] get_output_validator_list = [ ] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/app-discovery/sessions/{session-id}', path_variables={ 'session_id': 'session-id', }, query_parameters={ }, content_type='application/json' ) # properties for list operation list_input_type = type.StructType('operation-input', { 'cursor': type.OptionalType(type.StringType()), 'group_id': type.OptionalType(type.StringType()), 'included_fields': type.OptionalType(type.StringType()), 'page_size': type.OptionalType(type.IntegerType()), 'sort_ascending': type.OptionalType(type.BooleanType()), 'sort_by': type.OptionalType(type.StringType()), 'status': type.OptionalType(type.StringType()), }) list_error_dict = { 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.invalid_request': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'), 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/api/v1/app-discovery/sessions', path_variables={ }, query_parameters={ 'cursor': 'cursor', 'group_id': 'group_id', 'included_fields': 'included_fields', 'page_size': 'page_size', 'sort_ascending': 'sort_ascending', 'sort_by': 'sort_by', 'status': 'status', }, content_type='application/json' ) operations = { 'create': { 'input_type': create_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'AppDiscoverySession'), 'errors': create_error_dict, 'input_value_validator_list': create_input_value_validator_list, 'output_validator_list': create_output_validator_list, 'task_type': TaskType.NONE, }, 'delete': { 'input_type': delete_input_type, 'output_type': type.VoidType(), 'errors': delete_error_dict, 'input_value_validator_list': delete_input_value_validator_list, 'output_validator_list': delete_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'AppDiscoverySession'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'AppDiscoverySessionsListResult'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'create': create_rest_metadata, 'delete': delete_rest_metadata, 'get': get_rest_metadata, 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.nsx.app_discovery.sessions', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=False)